package com.xmtlxx.tms.mapper;

import com.xmtlxx.common.annotation.DataColumn;
import com.xmtlxx.common.annotation.DataPermission;
import com.xmtlxx.common.core.mapper.BaseMapperPlus;
import com.xmtlxx.tms.domain.Client;
import com.xmtlxx.tms.domain.bo.ClientBo;
import com.xmtlxx.tms.domain.vo.ClientVo;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 货主Mapper接口
 *
 * @author xmtlxx
 * @date 2022-08-15
 */
public interface ClientMapper extends BaseMapperPlus<ClientMapper, Client, ClientVo> {
    /**
     * 根据条件分页查询货主
     *
     * @param client 货主
     * @return Page Client
     */
    @DataPermission({
        @DataColumn(key = "tenantName", value = "c.create_by"),
        @DataColumn(key = "deptName", value = "c.dept_id"),
        @DataColumn(key = "userName", value = "c.create_by")
    })
    Page<ClientVo> selectPageClientList(@Param("page") Page<Client> page,@Param("client") ClientBo client);

    /**
     * 查询货主列表
     *
     * @param client 货主
     * @return 货主集合
     */
    @DataPermission({
        @DataColumn(key = "tenantName", value = "c.create_by"),
        @DataColumn(key = "deptName", value = "c.dept_id"),
        @DataColumn(key = "userName", value = "c.create_by")
    })
    List<ClientVo> selectClientList(@Param("client") ClientBo client);

    ClientVo selectClientVoByID(String id);

    ClientVo selectClientVoByDeptId(Long deptId);
}
